package main

import "fmt"

func main() {
	arr:=[...]string{"a","b","c","d","e","f","g","h","i","j","k"}
	fmt.Println("cap(arr):",cap(arr),arr)

	//cut arr to slice
	s1:=arr[2:8]
	fmt.Printf("s1类型：%T \n",s1)
	fmt.Println("cap(s1)=",cap(s1),s1)

	s2:=arr[4:7]
	fmt.Printf("s2类型：%T \n",s2)
	fmt.Println("cap(s2)=",cap(s2),s2)

	//cut slice to slice
	s3:=s1[3:9]
	fmt.Printf("s3类型：%T \n",s3)
	fmt.Println("截取S1[3:9]形成的s3:cap(s3)=",cap(s3),s3)

	s4:=s2[4:7]
	fmt.Printf("s4类型：%T \n",s4)
	fmt.Println("截取S2[4:7]形成的s4:cap(s4)=",cap(s4),s4)


	s4[0] = "x"
	fmt.Print(arr,s1,s2,s3,s4)
}
